package com.gudaichaoren.spider.pageprocesser;

import cn.hutool.core.util.StrUtil;
import com.gudaichaoren.spider.entity.LotteriesShuangseResults;
import com.sun.org.apache.bcel.internal.generic.NEW;
import us.codecraft.webmagic.selector.Selectable;

public class LotteriesShuangseDataSituation implements LotteriesShuangseData{

    private LotteriesShuangseResults lotteriesShuangseResults;

    public LotteriesShuangseDataSituation(LotteriesShuangseResults lotteriesShuangseResults) {
        this.lotteriesShuangseResults = lotteriesShuangseResults;
    }

    /**
     * 号码:class:style
     *
     * @return
     */
    private String splicingBallInfo(Selectable selectable) {
        //获取号码
        String ballNumber = selectable.xpath("//td/text()").toString();
//        String classType = selectable.xpath("//td/@class").get();
//        String styleType = selectable.xpath("//td/@style").get();
//        return StrUtil.join(":", ballNumber, classType, styleType);
        return ballNumber;
    }

    @Override
    public void setFirst(Selectable selectable) {
        lotteriesShuangseResults.setPeriod(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall01(Selectable selectable) {
        lotteriesShuangseResults.setRedBall01(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall02(Selectable selectable) {
        lotteriesShuangseResults.setRedBall02(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall03(Selectable selectable) {
        lotteriesShuangseResults.setRedBall03(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall04(Selectable selectable) {
        lotteriesShuangseResults.setRedBall04(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall05(Selectable selectable) {
        lotteriesShuangseResults.setRedBall05(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall06(Selectable selectable) {
        lotteriesShuangseResults.setRedBall06(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall07(Selectable selectable) {
        lotteriesShuangseResults.setRedBall07(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall08(Selectable selectable) {
        lotteriesShuangseResults.setRedBall08(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall09(Selectable selectable) {
        lotteriesShuangseResults.setRedBall09(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall10(Selectable selectable) {
        lotteriesShuangseResults.setRedBall10(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall11(Selectable selectable) {
        lotteriesShuangseResults.setRedBall11(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall12(Selectable selectable) {
        lotteriesShuangseResults.setRedBall12(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall13(Selectable selectable) {
        lotteriesShuangseResults.setRedBall13(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall14(Selectable selectable) {
        lotteriesShuangseResults.setRedBall14(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall15(Selectable selectable) {
        lotteriesShuangseResults.setRedBall15(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall16(Selectable selectable) {
        lotteriesShuangseResults.setRedBall16(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall17(Selectable selectable) {
        lotteriesShuangseResults.setRedBall17(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall18(Selectable selectable) {
        lotteriesShuangseResults.setRedBall18(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall19(Selectable selectable) {
        lotteriesShuangseResults.setRedBall19(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall20(Selectable selectable) {
        lotteriesShuangseResults.setRedBall20(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall21(Selectable selectable) {
        lotteriesShuangseResults.setRedBall21(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall22(Selectable selectable) {
        lotteriesShuangseResults.setRedBall22(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall23(Selectable selectable) {
        lotteriesShuangseResults.setRedBall23(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall24(Selectable selectable) {
        lotteriesShuangseResults.setRedBall24(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall25(Selectable selectable) {
        lotteriesShuangseResults.setRedBall25(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall26(Selectable selectable) {
        lotteriesShuangseResults.setRedBall26(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall27(Selectable selectable) {
        lotteriesShuangseResults.setRedBall27(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall28(Selectable selectable) {
        lotteriesShuangseResults.setRedBall28(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall29(Selectable selectable) {
        lotteriesShuangseResults.setRedBall29(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall30(Selectable selectable) {
        lotteriesShuangseResults.setRedBall30(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall31(Selectable selectable) {
        lotteriesShuangseResults.setRedBall31(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall32(Selectable selectable) {
        lotteriesShuangseResults.setRedBall32(splicingBallInfo(selectable));
    }

    @Override
    public void setRedBall33(Selectable selectable) {
        lotteriesShuangseResults.setRedBall33(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall01(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall01(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall02(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall02(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall03(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall03(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall04(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall04(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall05(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall05(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall06(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall06(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall07(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall07(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall08(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall08(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall09(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall09(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall10(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall10(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall11(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall11(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall12(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall12(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall13(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall13(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall14(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall14(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall15(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall15(splicingBallInfo(selectable));
    }

    @Override
    public void setBlueBall16(Selectable selectable) {
        lotteriesShuangseResults.setBlueBall16(splicingBallInfo(selectable));
    }

    public LotteriesShuangseResults getLotteriesShuangseResults() {
        return lotteriesShuangseResults;
    }
}
